<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>demo</title>
    <script src="https://unpkg.com/vue@3.0.5/dist/vue.global.js"></script>
  </head>

  <body>
    <div id="app"></div>
    <script>
      const app = Vue.createApp({
        data() {
          return {
            checked: false,
            arr: [],
            value: "空",
            desc: "还未点",
            sqvalue: "空",
            num: 0,
            str: "",
          };
        },
        methods: {},
        template: `
          <div>
            是否选中：<br/>
            <input type='checkbox' v-model='checked' />{{checked}}<br/>
            多选：<br/>
            {{arr}}<br/>
            <input type='checkbox' v-model='arr' value='1' />1
            <input type='checkbox' v-model='arr' value='2' />2
            <input type='checkbox' v-model='arr' value='3' />3
            <br/>
            单选：<br/>
            {{value}}<br/>
            <input type='radio' v-model='value' value='1' />1
            <input type='radio' v-model='value' value='2' />2
            <input type='radio' v-model='value' value='3' />3
            <br/>
            修饰符：<br/>
            <input type='checkbox' v-model='desc' true-value='选中' false-value='未选中' />{{desc}}<br/>
            失去焦点执行：<br/>
            <input type='text' v-model.lazy='sqvalue' /><br/>
            {{sqvalue}}<br/>
            输入数字类型：<br/>
            <input type='text' v-model.number='num' />类型:{{typeof num}}<br/>
            完成后去掉前后空格：<br/>
            <input type='text' v-model.trim='str' /><br/>
          </div>
        `,
      });

      const vm = app.mount("#app");
    </script>
  </body>
</html>
